﻿@model Mvc4.Models.Search

@{
    Layout = "~/Views/Shared/_SiteMainLayout.cshtml";
}
<div style="width: 70%; float:left">
    <h2 class="blue-font-title"><img src="~/Images/rating_32.png"/> The most populars</h2>
    @foreach (var item in Model.Goods) {
        <div class="span2">
            <a href="/@ViewBag.Name/View/@Html.DisplayFor(modelItem => item.Id)">
                <h4 class="blue-font">@Html.DisplayFor(modelItem => item.Name)</h4>
            </a>
            <img style="border: 1px solid #aeaeae;" src="@Url.Action("GetImage", "HomeSite", new { goodId = item.Id })" />
            <p>@Html.DisplayFor(modelItem => item.Likes) users like this!</p>            
        </div>
    }
    <div id="news" style="display: inline-block; margin-top: 50px;">
        @Html.Action("_RSSFeed", "RSSFeed", new { siteId = ViewBag.siteId })
    </div>
</div>
<script type="text/javascript">
    function CrearMapa(){
        var mapOptions = {
            center: new google.maps.LatLng(-34.900011,-56.146317),
            zoom: 10,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };

        var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

         @foreach (var item in Model.Goods ) 
          {
             <text>var mark = new google.maps.Marker({
             position: new google.maps.LatLng(@item.Latitude.ToString().Replace(",", ".") , @item.Longitude.ToString().Replace(",", ".")),
             map: map,
             title: '@item.Name' 
         });
             </text>
          }
    }
</script>


